<!DOCTYPE html>
<html>
<head>
    <title>知识库</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <Row :gutter="16" style="margin: 8px 0px 0px 1px">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.title" @on-enter="query" placeholder="标题"></i-input>
                </i-col>
                <i-col span="4">
                    <i-input v-model="q.keyTitile" @on-enter="query" placeholder="标签"></i-input>
                </i-col>
                <i-col span="4">
                    <i-select v-model="q.konwType" placeholder="是否通用">
                        <i-option  value="" >请选择</i-option>
                        <i-option v-for="item in proTypeList" :value="item.value" :key="item.value">{{item.name}}
                        </i-option>
                    </i-select>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
        </Row>
        <Row :gutter="16" style="margin: 3px 0px 0px 0px;">
            <div class="buttons-group">
                #if($shiro.hasPermission("knowbase:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("knowbase:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("knowbase:changeDelCode"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
        <i-form ref="formValidate" :model="knowBase" :rules="ruleValidate" :label-width="80">
            <Row>
                <i-col span="11">
                    <Form-item label="标题" prop="title">
                        <i-input v-model="knowBase.title" placeholder="标题"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="是否通用" prop="keyTitile">
                        <i-select @on-change="onselect" v-model="knowBase.proType" placeholder="是否通用">
                            <i-option  value="" >请选择</i-option>
                            <i-option v-for="item in proTypeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="标签" prop="keyTitile">
                        <i-input v-model="knowBase.keyTitile" placeholder="标签"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row v-if="sheb">
                <i-col span="11">
                    <Form-item label="设备编码" prop="devCode">
                        <i-input v-model="knowBase.devCode" placeholder="设备编码" readonly icon="md-arrow-dropdown-circle" @on-click="getDeviceInfo" ></i-input>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="设备名称" prop="devName">
                        <i-input v-model="knowBase.devName" placeholder="设备名称" readonly></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="11">
                    <Form-item label="模块类型" prop="type">
                        <i-select v-model="knowBase.type" placeholder="模块类型">
                            <i-option v-for="item in moduleTypeList" :value="item.value" :key="item.value">{{item.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
                <i-col span="11">
                    <Form-item label="知识归类" prop="konwType">
                        <i-select v-model="knowBase.konwType" placeholder="知识归类">
                            <i-option  value="" >请选择</i-option>
                            <i-option v-for="item in knowTypeList" :value="item.id" :key="item.id">{{item.konwName}}
                            </i-option>
                        </i-select>
                    </Form-item>
                </i-col>
            </Row>

            <Row>
                <i-col span="22">
                    <Form-item label="原因" prop="reason">
                        <i-input type="textarea" v-model="knowBase.reason" placeholder="原因"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Row>
                <i-col span="22">
                    <Form-item label="内容" prop="contents">
                        <i-input type="textarea" v-model="knowBase.contents" placeholder="内容"></i-input>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px">
                返回</i-button>
                <i-button type="info" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>

<script src="${rc.contextPath}/js/sys/knowbase.js?_${date.systemTime}"></script>
</body>
</html>
